package com.yunfeng.common.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yunfeng.common.dao.PermissionDAO;
import com.yunfeng.common.entity.impl.Permission;
import com.yunfeng.common.service.PermissionService;

@Service
@Transactional
public class PermissionServiceImpl implements PermissionService {

	@Autowired
	private PermissionDAO permissionDAO;

	/**
	 * @param permission
	 * @see com.yunfeng.common.service.PermissionService#save(com.yunfeng.common.entity.impl.Permission)
	 */
	@Override
	public void save(Permission permission) {
		permissionDAO.save(permission);
	}

	/**
	 * @param id
	 * @return
	 * @see com.yunfeng.common.service.PermissionService#get(java.lang.Long)
	 */
	@Override
	public Permission get(Long id) {
		return permissionDAO.findOne(id);
	}

	/**
	 * @param permission
	 * @see com.yunfeng.common.service.PermissionService#update(com.yunfeng.common.entity.impl.Permission)
	 */
	@Override
	public void update(Permission permission) {
		permissionDAO.save(permission);
	}

	/**
	 * @param id
	 * @see com.yunfeng.common.service.PermissionService#delete(java.lang.Long)
	 */
	@Override
	public void delete(Long id) {
		permissionDAO.delete(id);
	}
}
